package purchaseManage;

import java.util.ArrayList;

import po.Book;
import po.Member;

public class Purchase_Stub implements PurchaseBLService {

	public Book book;
	public String MemberInfo;
	public double totalPrice;

	public Purchase_Stub(Book book, String MemberInfo, double totalPrice) {
		super();
		this.book = book;
		this.MemberInfo = MemberInfo;
		this.totalPrice = totalPrice;
	}

	public boolean login(String name, String password) {

		if (name.equals("admin") && password.equals("admin")) {
			System.out.println("Login Succeed!");
			return true;
		}
		System.out.println("Login Fail!");
		return false;
	}

	public Book getBookByISBN(String isbn) {

		return book;
	}

	public void addPurchaseItem(Book book) {

		System.out.println("Add purchaseItem succeed!");
	}

	public void deletePurchaseItem(Book book) {

		System.out.println("Delete purchaseItem succeed!");
	}

	public void collectBook(Book book) {

		System.out.println("Collect succeed!");
	}

	public double getTotal(int equalCard, int discoutCard, int Credit) {

		return totalPrice;
	}

	public void cancelPurchase() {

		System.out.println("Cancel Purchase!");
	}

	public void endPurchase() {

		System.out.println("End purchase");
	}

	public Member getMemberByID(int id) {
		System.out.println("Get Succeed!");
		return null;
	}

	public ArrayList<Book> getBookByPress(String press) {
		System.out.println("Get Succeed!");
		ArrayList<Book> list = new ArrayList<>();
		list.add(book);
		return list;

	}

}
